package com.gemantic.task.model;


import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author xiedi
 * @date 2022/09/15
 **/
public class Task extends BaseTask implements Serializable {
    private Long id;
    private String orderNo;
    private String type;
    private String remark;
    private String status;
    private Integer version;
    private Integer priority;
    private Integer retryTimes;
    private Integer maxRetryTimes;
    private Date nextRunTime;
    private Date createTime;
    private Date updateTime;
    private String requestData;
    private String responseData;
    private static final long serialVersionUID = 1L;

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    @Override
    public Long getPrimaryKey() {
        return this.id;
    }

    public Long getId() {
        return this.id;
    }

    @Override
    public String getOrderNo() {
        return this.orderNo;
    }

    @Override
    public String getType() {
        return this.type;
    }

    public String getRemark() {
        return this.remark;
    }

    @Override
    public String getStatus() {
        return this.status;
    }

    public Integer getVersion() {
        return this.version;
    }

    @Override
    public Integer getRetryTimes() {
        return this.retryTimes;
    }

    @Override
    public Integer getMaxRetryTimes() {
        return this.maxRetryTimes;
    }

    @Override
    public Date getNextRunTime() {
        return this.nextRunTime;
    }

    @Override
    public Date getCreateTime() {
        return this.createTime;
    }

    public Date getUpdateTime() {
        return this.updateTime;
    }

    @Override
    public String getRequestData() {
        return this.requestData;
    }

    @Override
    public String getResponseData() {
        return this.responseData;
    }


    public void setId(final Long id) {
        this.id = id;
    }

    public void setOrderNo(final String orderNo) {
        this.orderNo = orderNo;
    }

    public void setType(final String type) {
        this.type = type;
    }


    public void setStatus(final String status) {
        this.status = status;
    }

    public void setVersion(final Integer version) {
        this.version = version;
    }

    public void setRetryTimes(final Integer retryTimes) {
        this.retryTimes = retryTimes;
    }

    public void setMaxRetryTimes(final Integer maxRetryTimes) {
        this.maxRetryTimes = maxRetryTimes;
    }

    public void setNextRunTime(final Date nextRunTime) {
        this.nextRunTime = nextRunTime;
    }

    public void setCreateTime(final Date createTime) {
        this.createTime = createTime;
    }

    public void setUpdateTime(final Date updateTime) {
        this.updateTime = updateTime;
    }

    public void setRequestData(final String requestData) {
        this.requestData = requestData;
    }

    @Override
    public void setResponseData(final String responseData) {
        this.responseData = responseData;
    }

    @Override
    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Task task = (Task) o;
        return Objects.equals(id, task.id) && Objects.equals(orderNo, task.orderNo) && Objects.equals(type, task.type) && Objects.equals(remark, task.remark) && Objects.equals(status, task.status) && Objects.equals(version, task.version) && Objects.equals(retryTimes, task.retryTimes) && Objects.equals(maxRetryTimes, task.maxRetryTimes) && Objects.equals(nextRunTime, task.nextRunTime) && Objects.equals(createTime, task.createTime) && Objects.equals(updateTime, task.updateTime) && Objects.equals(requestData, task.requestData) && Objects.equals(responseData, task.responseData);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, orderNo, type, remark, status, version, retryTimes, maxRetryTimes, nextRunTime, createTime, updateTime, requestData, responseData);
    }
}
